#include <stdio.h>

struct list {
	int size;
	int a[100];
};

int main() {
	list l1;
	int n;
	scanf("%d", &n);
	int min = 10000;
	int index = 0;
	for (int i = 0; i < n; i++) {
		scanf("%d", &l1.a[i]);
		if (min > l1.a[i]) {
			min = l1.a[i];
			index = i;
		}
	}
	l1.a[index] = l1.a[0] ^ l1.a[index];
	l1.a[0] = l1.a[0] ^ l1.a[index];
	l1.a[index] = l1.a[0] ^ l1.a[index];
	for (int i = 0; i < n; i++) {
		printf("%d ", l1.a[i]);
	}

}